const express = require('express');
const router = express.Router();

router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 100; i++) content.push({
        id: `id${i}`,
        code: 'string',
        brandName: 'string',
        brandCode: 'string',
        dealerCode: 'string',
        dealerName: 'string',
        subDealerCode: 'string',
        subDealerName: 'string',
        customerCode: 'string',
        customerName: 'string',
        userName: 'string',
        VIN: 'string',
        testDriveYear: 0,
        testDriveMonth: 0,
        createTime: '2020-04-10T01:40:22.900Z',
        status: 0,
        rowVersion: 'string',
        options: [
            'update',
            'abandon',
            'effective',
        ]
    });

    res.json({
        message: 'ok',
        payload: {
            content,
            totalElements: 40,
        }
    });
});

router.get('/:id', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            id: '001',
            brandName: 'string',
            brandCode: 'string',
            dealerCode: 'string',
            dealerName: 'string',
            subDealerCode: 'string',
            subDealerName: 'string',
            customerCode: 'string',
            customerName: 'string',
            userName: 'string',
            VIN: 'string',
            testDriveYear: 0,
            testDriveMonth: 0,
            createTime: '2020-04-10T01:41:26.019Z',
            status: 0,
            rowVersion: 'string',
            options: [
                'update',
                'abandon',
                'effective',
            ],
            country: 'string',
            cellPhoneNumber: 'string',
            birthday: '2020-04-10T01:41:26.019Z',
            gender: 0,
            purchaseOrNot: true,
            trackCustomerOrNot: true,
            estimatedTimeForDeal: '2020-04-10T01:41:26.019Z',
            dealOrNot: true,
            productCode: 'string',
            productName: 'string',
            modelCode: 'string',
            modelName: 'string',
            saleConfirmationCode: 'string',
            localLicensePlateNumber: 'string',
            useVehicleStickerOrNot: true,
            keepTestDrivePhotoOrNot: true,
            putIntoUseTime: '2020-04-10T01:41:26.019Z',
            fOBPercentImplementedOrNot: true,
            timeForImplementation: 'string',
            timeOfUse: '2020-04-10T01:41:26.019Z',
            drivingMileage: 0,
            timeOfReturn: '2020-04-10T01:41:26.019Z',
            returnStatus: 0,
            mileageWhenReturn: 0,
            remark: 'string',
            occupationType: 0,
            drivingAge: 0,
            salesConsultantName: 'string',
            evaluationDate: '2020-04-10T01:41:26.019Z',
            dynamicsPerformance: 0,
            maneuverability: 0,
            brakePerformance: 0,
            drivingComfort: 0,
            interiorSpace: 0,
            testDriveService: 0,
            conditionAndCleanliness: 0,
            routeLength: 0,
            driveRoute: 0,
            overallMerit: 0,
            testDriveMeaningfulToPurchasing: true,
            testDriveStatus: 0,
            creatorName: 'string',
            modifierName: 'string',
            modifyTime: 'string',
            effectPersonName: 'string',
            effectTime: '2020-04-10T01:41:26.019Z',
            abandonerName: 'string',
            abandonTime: '2020-04-10T01:41:26.019Z',
            opinionsAndSuggestions: 'string',
            attachments: [{
                fileId: 'te1232-131232-1we',
                fileName: '安装背景图1'
            },
            {
                fileId: 'qww1-232131-12e',
                fileName: '安装背景图2'
            }]
        },
        totalElements: 40,
    });
});

router.put('/:id/', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});

router.put('/:id/abandon', (req, res) => {
    res.json({
        message: '作废'
    });
});
router.put('/:id/effective', (req, res) => {
    res.json({
        message: '生效'
    });
});

router.get('/importTemp', (req, res) => {
    res.json({
        message: '导出'
    });
});
router.get('/export/forCurrentUser', (req, res) => {
    res.json({
        message: '导出'
    });
});
router.post('/import', async(req, res) => {
    res.json({
        message: '导入'
    });
});
module.exports = router;
